package main

import (
	"context"
	"encoding/json"
	"fmt"
	"gitee.com/leo-xin/novel_distribution_sdk_go/yuewen"
	"gitee.com/leo-xin/novel_distribution_sdk_go/yuewen/config"
	"io"
)

func RechargeGetRechargeLog() {

	ctx := context.Background()

	configuration := config.NewConfiguration()
	configuration.LogEnable = true

	resp, httpRes, err := yuewen.Init(configuration).UseQuickApp().RechargeGetRechargeLogApi().
		Get(ctx).
		ApiSecret(ApiSecret).Email(Email).
		AppFlag("quickrmphgzzy").StartTime(1727049600).EndTime(1727112600).
		OpenId("d9d47898b1a6050414f7bb0eb3ade852").
		Execute()

	//resp, httpRes, err := yuewen.Init(configuration).UseDuanPian().RechargeGetRechargeLogApi().
	//	Get(ctx).
	//	ApiSecret(ApiSecret).Email(Email).AppFlag("dpfxxxzxgzzy80840").
	//	StartTime(1727049600).EndTime(1727112600).OpenId("oyTgg7bn4NdkSJRlarAfW7tqrmtc").
	//	Execute()

	s, _ := json.Marshal(resp)
	fmt.Println(string(s))

	if httpRes != nil {
		resBytes, _ := io.ReadAll(httpRes.Body)
		fmt.Println(string(resBytes))

	}
	fmt.Println(err)

}
